package com.sailfish.springbootdemo.dao.db8;

import com.sailfish.springbootdemo.common.DB8TableName;
import com.sailfish.springbootdemo.pojo.db8.IntfFromVplWebPinnumber;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IntfFromVplWebPinnumberDao {
    @Insert("<script>" +
            "insert into " + DB8TableName.INTF_FROM_VPLWEB_PINNUMBER + " " +
            "( "+
            "GUID, " +
            "pkg_name, " +
            "pad_name, " +
            "pin_number, " +
            "pin_x, " +
            "pin_y, " +
            "regular_pad_length, " +
            "regular_pad_width, " +
            "drill_hole_length, " +
            "drill_hole_width, " +
            "drill_hole_tol_p, " +
            "drill_hole_tol_n, " +
            "anti_pad_size, " +
            "thermal_pad_size, " +
            "creator " +
            ")"+
            "values "+
            "<foreach collection=\"entities\" item=\"entity\" separator=\",\">" +
            "(" +
            "#{entity.GUID}, " +
            "#{entity.pkg_name}, " +
            "#{entity.pad_name}, " +
            "#{entity.pin_number}, " +
            "#{entity.pin_x}, " +
            "#{entity.pin_y}, " +
            "#{entity.regular_pad_length}, " +
            "#{entity.regular_pad_width}, " +
            "#{entity.drill_hole_length}, " +
            "#{entity.drill_hole_width}, " +
            "#{entity.drill_hole_tol_p}, " +
            "#{entity.drill_hole_tol_n}, " +
            "#{entity.anti_pad_size}, " +
            "#{entity.thermal_pad_size}, " +
            "#{entity.creator} " +
            ")"+
            "</foreach>"+
            "</script>"
    )
    Integer insertIntfFromVplWebPinnumberBatch(@Param("entities") List<IntfFromVplWebPinnumber> entities);

}
